# from texttable import Texttable
# from ipdb import set_trace
import torch
from datetime import datetime, timedelta

class DefaultConfig(object):
    """
    user can set default hyperparamter here
    hint: don't use 【parse】 as the name
    """

    # 路径相关
    path = './data/'

    seed = 1

    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') 

    # 优化器:
    lr = 2e-5


    # 输入相关
    train_batch_size = 64
    val_batch_size = 64
    test_batch_size = 1

    num_epochs = 2
    model_path = './checkpoints/net_dict1_multi4_pic111add_copy.pt'
    log_time = (datetime.utcnow()+ timedelta(hours=8)).strftime("%Y%m%d:%H:%M:%S")
    
    known_sig = ['T001','T010','T011','T100','T101']
    all_sig = ['T000','T001','T010','T011','T100','T101']
    # def parse(self, kwargs):
    #     '''
    #     user can update the default hyperparamter
    #     '''
    #     for k, v in kwargs.items():
    #         if not hasattr(self, k):
    #             raise Exception('opt has No key: {}'.format(k))
    #         setattr(self, k, v)

    #     """
    #     一些依赖于其他超参数的超参数设置
    #     """
    #     setattr(self, 'print_opt', "model_{}_lr_{}_bs_{}".format(self.model, self.lr, self.train_batch_size))
    #     path = ['train_out_path', 'dev_out_path', 'test_out_path']
    #     for each in path:
    #         setattr(self, each, getattr(self, each) + '_'+ self.print_opt)

    #     """
    #     print the information of hyperparater
    #     """
    #     t = Texttable()
    #     t.add_row(["Parameter", "Value"])
    #     print('user config:')
    #     for k, v in self.__class__.__dict__.items():
    #         if not (k.startswith('__') or k == 'parse'):
    #             t.add_row(["P:" + str(k), "V:" + str(getattr(self, k))])
    #     print(t.draw())


opt = DefaultConfig()
